{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 作业说明\n",
    "在Pima Indians Diabetes Data Set（皮马印第安人糖尿病数据集）进行分类器练习，数据集只有一个文件（diabetes.csv）：Pima Indians Diabetes Dataset 包括根据医疗记录的比马印第安人5 年内糖尿病的发病情况，这是一个两类分类问题。每个类的样本数目数量不均等。一共有 768 个样本，每个样本有8 个输入变量和1 个输出变量。缺失值通常用零值编码。\n",
    "\n",
    "1) 字段说明  \n",
    "    Pregnancies： 怀孕次数  \n",
    "    Glucose： 口服葡萄糖耐受试验中，2 小时的血浆葡萄糖浓度。  \n",
    "    BloodPressure： 舒张压（mm Hg）  \n",
    "    SkinThickness： 三头肌皮肤褶层厚度（mm）  \n",
    "    Insulin：2 小时血清胰岛素含量（μU/ ml）  \n",
    "    BMI： 体重指数（体重，kg /（身高，m）^ 2）  \n",
    "2) DiabetesPedigreeFunction： 糖尿病家族史  \n",
    "3) Age： 年龄（岁）  \n",
    "    Outcome： 输出变了/类别标签（0 或 1，出现糖尿病为1, 否则为 0）  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 导入必要工具包"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd \n",
    "import numpy as np\n",
    "\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "\n",
    "#竞赛的评价指标为logloss\n",
    "#from sklearn.metrics import log_loss  \n",
    "#SVM并不能直接输出各类的概率，所以在这个例子中我们用正确率作为模型预测性能的度量\n",
    "from sklearn.metrics import accuracy_score\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "from matplotlib import pyplot\n",
    "import seaborn as sns\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 读取数据 & 数据探索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pregnancies</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>BloodPressure</th>\n",
       "      <th>SkinThickness</th>\n",
       "      <th>Insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>DiabetesPedigreeFunction</th>\n",
       "      <th>Age</th>\n",
       "      <th>Outcome</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>6</td>\n",
       "      <td>148</td>\n",
       "      <td>72</td>\n",
       "      <td>35</td>\n",
       "      <td>0</td>\n",
       "      <td>33.6</td>\n",
       "      <td>0.627</td>\n",
       "      <td>50</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>85</td>\n",
       "      <td>66</td>\n",
       "      <td>29</td>\n",
       "      <td>0</td>\n",
       "      <td>26.6</td>\n",
       "      <td>0.351</td>\n",
       "      <td>31</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>8</td>\n",
       "      <td>183</td>\n",
       "      <td>64</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>23.3</td>\n",
       "      <td>0.672</td>\n",
       "      <td>32</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>89</td>\n",
       "      <td>66</td>\n",
       "      <td>23</td>\n",
       "      <td>94</td>\n",
       "      <td>28.1</td>\n",
       "      <td>0.167</td>\n",
       "      <td>21</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>137</td>\n",
       "      <td>40</td>\n",
       "      <td>35</td>\n",
       "      <td>168</td>\n",
       "      <td>43.1</td>\n",
       "      <td>2.288</td>\n",
       "      <td>33</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Pregnancies  Glucose  BloodPressure  SkinThickness  Insulin   BMI  \\\n",
       "0            6      148             72             35        0  33.6   \n",
       "1            1       85             66             29        0  26.6   \n",
       "2            8      183             64              0        0  23.3   \n",
       "3            1       89             66             23       94  28.1   \n",
       "4            0      137             40             35      168  43.1   \n",
       "\n",
       "   DiabetesPedigreeFunction  Age  Outcome  \n",
       "0                     0.627   50        1  \n",
       "1                     0.351   31        0  \n",
       "2                     0.672   32        1  \n",
       "3                     0.167   21        0  \n",
       "4                     2.288   33        1  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 读取数据\n",
    "data = pd.read_csv(\"diabetes.csv\")\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 768 entries, 0 to 767\n",
      "Data columns (total 9 columns):\n",
      "Pregnancies                 768 non-null int64\n",
      "Glucose                     768 non-null int64\n",
      "BloodPressure               768 non-null int64\n",
      "SkinThickness               768 non-null int64\n",
      "Insulin                     768 non-null int64\n",
      "BMI                         768 non-null float64\n",
      "DiabetesPedigreeFunction    768 non-null float64\n",
      "Age                         768 non-null int64\n",
      "Outcome                     768 non-null int64\n",
      "dtypes: float64(2), int64(7)\n",
      "memory usage: 54.1 KB\n"
     ]
    }
   ],
   "source": [
    "data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pregnancies</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>BloodPressure</th>\n",
       "      <th>SkinThickness</th>\n",
       "      <th>Insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>DiabetesPedigreeFunction</th>\n",
       "      <th>Age</th>\n",
       "      <th>Outcome</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>3.845052</td>\n",
       "      <td>120.894531</td>\n",
       "      <td>69.105469</td>\n",
       "      <td>20.536458</td>\n",
       "      <td>79.799479</td>\n",
       "      <td>31.992578</td>\n",
       "      <td>0.471876</td>\n",
       "      <td>33.240885</td>\n",
       "      <td>0.348958</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.369578</td>\n",
       "      <td>31.972618</td>\n",
       "      <td>19.355807</td>\n",
       "      <td>15.952218</td>\n",
       "      <td>115.244002</td>\n",
       "      <td>7.884160</td>\n",
       "      <td>0.331329</td>\n",
       "      <td>11.760232</td>\n",
       "      <td>0.476951</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.078000</td>\n",
       "      <td>21.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>62.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>27.300000</td>\n",
       "      <td>0.243750</td>\n",
       "      <td>24.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>3.000000</td>\n",
       "      <td>117.000000</td>\n",
       "      <td>72.000000</td>\n",
       "      <td>23.000000</td>\n",
       "      <td>30.500000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>0.372500</td>\n",
       "      <td>29.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>6.000000</td>\n",
       "      <td>140.250000</td>\n",
       "      <td>80.000000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>127.250000</td>\n",
       "      <td>36.600000</td>\n",
       "      <td>0.626250</td>\n",
       "      <td>41.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>17.000000</td>\n",
       "      <td>199.000000</td>\n",
       "      <td>122.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>846.000000</td>\n",
       "      <td>67.100000</td>\n",
       "      <td>2.420000</td>\n",
       "      <td>81.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Pregnancies     Glucose  BloodPressure  SkinThickness     Insulin  \\\n",
       "count   768.000000  768.000000     768.000000     768.000000  768.000000   \n",
       "mean      3.845052  120.894531      69.105469      20.536458   79.799479   \n",
       "std       3.369578   31.972618      19.355807      15.952218  115.244002   \n",
       "min       0.000000    0.000000       0.000000       0.000000    0.000000   \n",
       "25%       1.000000   99.000000      62.000000       0.000000    0.000000   \n",
       "50%       3.000000  117.000000      72.000000      23.000000   30.500000   \n",
       "75%       6.000000  140.250000      80.000000      32.000000  127.250000   \n",
       "max      17.000000  199.000000     122.000000      99.000000  846.000000   \n",
       "\n",
       "              BMI  DiabetesPedigreeFunction         Age     Outcome  \n",
       "count  768.000000                768.000000  768.000000  768.000000  \n",
       "mean    31.992578                  0.471876   33.240885    0.348958  \n",
       "std      7.884160                  0.331329   11.760232    0.476951  \n",
       "min      0.000000                  0.078000   21.000000    0.000000  \n",
       "25%     27.300000                  0.243750   24.000000    0.000000  \n",
       "50%     32.000000                  0.372500   29.000000    0.000000  \n",
       "75%     36.600000                  0.626250   41.000000    1.000000  \n",
       "max     67.100000                  2.420000   81.000000    1.000000  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 各属性统计特征\n",
    "data.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从数据的大致取值可以看出，数据没有做脱敏处理，有单位和具体的物理含义，train.info虽然显示没有缺失值，但有些特征数据明显不对，如舒张压和体重等特征都不应该存在零值，（舒张压为0是说明这个人已经挂了么，体重身高比为0[捂脸]）应该是存在缺失值，但直接使用了零值进行填充"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEKCAYAAAAIO8L1AAAABHNCSVQICAgIfAhkiAA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U5vXT8DXFBVrwYuBM4Z+pr9GYTTbwBXAGe3Wl6V5MgkBwG/A7ylqo4CNgFnPBe/sNRX538A0jwSumev3Vl7l+OAS6vqXoCqmlq/4PXASW37c8AfDR1zRVVVkpuBe6rqZoAktwBLGUyaeATw9cFVMPZlMOWENGsMCM13twD/fLghyU8ymOH2QZ55lv3CnXxH3zAZ7vNYe39yaHtqfwHwBLChqt7d43ulkfASk+a7jcBPJDkVnlqC9SwGS13eDhyZZK8khzFYfW/K/0uyz9B3vCvJge07Dmjtf81gdlyAU4C/2oW6rgWOTfKK9p0/keSVu/rLSXvCgNC8VoPZKt8BnJzkNuB/AY8yuEvp68D/Bm4GPgncMHToWuCmJBe22W8/BlyT5EbgU63PB4DTktwEvIenxyb61LUd+GXgonb8tcDf293fU9odzuYqSerkGYQkqZMBIUnqZEBIkjoZEJKkTgaEJKmTASFJ6mRASJI6GRCSpE7/H6faJrOoDn8hAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Target 分布，看看各类样本分布是否均衡\n",
    "sns.countplot(data.Outcome);\n",
    "pyplot.xlabel('Outcome');\n",
    "pyplot.ylabel('Number of occurrences');"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "分类结果中正例的样本约为反例样本的一半多一些，样本不均衡，交叉验证对分类任务缺省的是采用StratifiedKFold，在每折采样时根据各类样本按比例采样"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 单变量分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAENCAYAAAAVPvJNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF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dG+o07tlXV8iTPpRnA8M+G8P8mAW5BaA5r988/SDNu0+/T3AHsriRPa6e/RTNi6O1V9bmqWlvNTZzOAV7d1ri0mgHaflVV19OMf/P7m/nWP6yqz1TVL2kCYU9gjyR70ITQu6rqZ9WMbHsizYCI69xdVZ9qe/l/NOPsPAl4QlX9a1XNygFwCdyC0Nx3Gc2Ag09tnz9A8wf+Oe30k4BnJ+m9I908mkHUSPJs4MM0Ww/bA49i8/eL+PXInlX1UDOoKzsBu9FsFaxu50HzIa33pla9z6G5adMHge8kuR/4WFWdspnvLw2FAaG57jLgFTRj+P93moA4hiYgPg0sBi6rqhdvZP0vtssdUlX/muQTNLuOYMtvPnUnzYin82v9LTU39LCa1Qwj/R8Bkvwe8A9JLq+qWza1njQM7mLSXHcZzf77x1QzPv63aG6k9Dia4dEvAH47yeuTbNd+/W6Sp7frPxa4rw2HA4D/0FN7muaWrH1di1DNrT0vAj6WZOck2yR5SpKN7rJKclSa+4MD3E8TBL/sWPTefvuQ+mVAaE6rqh8AP6UJBqq5reutwLeruZPXgzQ3MDqa5m6D99Dc4vNRbYm3Av8tyYM0B7LP6qn9EHAC8O0kDyQ5sI+W3kCzq+pGmj/4Z9Mco9iY3wWuTPJTmvsFvLOqbutY7mTgGW0fX+mjD2mzvB+EJKmTWxCSpE4GhCSpkwEhSepkQEiSOhkQkqROBoQkqZMBIUnqZEBIkjoZEJKkTv8fwjnhW5sYfMoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#Pregnancies：离散变量，用countplot\n",
    "fig = plt.figure()\n",
    "# sns.distplot(data.weathersit.values, bins=30, kde=False)\n",
    "sns.countplot(data.Pregnancies.values)\n",
    "plt.xlabel('weathersit', fontsize=12)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "随怀孕次数增多，样本逐渐减少，大多集中在0-2次，十次以上的样本非常少,比较符合常理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\axes\\_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAENCAYAAAAPAhLDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xt8XGWd+PHPNzO5Nvdbc2/aJr0XeklboKDVKhRUilKk4AUVZVVwdXV/K7ir6+KyK653RdeuIIhKQUCMWgG1IJRL2/QCbdqGpk3TJr0kadLcmnu+vz/mFGOaNNN0kpOZ+b5fr7x65sxzznyfzmS+ec7znOcRVcUYY4yJcDsAY4wxE4MlBGOMMYAlBGOMMQ5LCMYYYwBLCMYYYxyWEIwxxgCWEIwxxjgsIRhjjAEsIRhjjHF43Q7gfKSnp2thYaHbYRhjTFDZtm1bg6pmjFQuqBJCYWEhZWVlbodhjDFBRUSq/Slnl4yMMcYAlhCMMcY4LCEYY4wBLCEYY4xx+JUQRGSViFSISKWI3DnE89Ei8qjz/GYRKXT2p4nIcyLSJiI/HHRMlIisE5E3RGSfiFwfiAoZY4wZnRFHGYmIB7gPeCdQA2wVkVJV3TOg2K1Ak6oWicha4F7gRqAT+DIwz/kZ6F+BOlWdISIRQOoF18YYY8yo+dNCWApUqupBVe0G1gOrB5VZDTzkbD8OrBQRUdV2Vd2ELzEM9jHgvwFUtV9VG0ZVA2OMMQHhT0LIBY4MeFzj7BuyjKr2As1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6Ww1eBOhFZLyI5TtEpwG+cBHUK32pdffj6OYwZc5YQTDh5BejC/2VM24G4Mw9EJGvAcw1AJ77FYgY7iu/L/cxxgm/O/FoAVf2Vql7ulFHgXqfoEXyzhCYP+IlR1Vo/4zXmglhCMGFDVU8B/4FvAfg1IhLvdOQuACYNcchrwFwRWSAiMfj+qj9zrn7gAeDbIpIjIh4RuVREooHHgHeJyEpnsZUv4EtEL4vITBF5u1OuE+jA1woA+F/gHhGZAiAiGSISLmtwmwnAEoIJK6r6DeDz+DqA64ATwE+ALwIvDyr7Br5RSX/GNw/+3404Av4Z3xz4W/EtRn8vEKGqFcAHgR/ga0m8B3iPqnbj6z/4urP/OL61eb/knO97+NYYeFZEWoFXgWUBqroxI7L1EIwxxgDWQjDGGOOwhGCMMQawhGCMMcZhCcEYYwxgCcEYY4zDEoIxxhjAEoIxxhiHJQRjjDGAJQRjjDGO/w/vGMjPC739ggAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#Glucose\n",
    "fig = plt.figure()\n",
    "sns.distplot(data.Glucose.values, bins=30, kde=True)#\n",
    "plt.xlabel('Glucose', fontsize=12)\n",
    "#在画板上显示\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "血浆葡萄糖浓度，正常情况下应该不会出现0值，应该是数据缺失，除了0值，其他的数据大致正态分布，符合常理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\axes\\_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgo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wZl4RybWGyaYTLJUtd1ZP7J8IbBMVYdVdadGPmdOAPh7J/5+4IvAz1R1l6r6VfUBYJDgHQqNmRRLEmYu+Jiq5hCcpO5m4Hln6uNQiwhePQCgqj1AK8GbqrxrnaMmZF27qvaOWjdagarmquoZqvqjUetCb+SyDNjoVPN0OMntBoK/9gE+QXCixRqniutCZ/m/EJxA7g8iUjXJxvFmpyouNIZvjophiXOsxkyKJQkzZzi/in8D+AnOchuqgeAfRwCcap98oH70OsdSZ10jkOuUD103qdBCntcCz6tqTsgjQ1W/4hzDHlXdTLAq6rfAI87yblX9pqouBz4KfENErnD22UfwFqQjRifI0VcctcD3R8WQ5lxBGTMpliTMnOG0CWwmOEX3oVGrHwI+LyLnOHXvPwB2qWo1sB04TUSuF5EEEfkUwcbv36tqDcHpv78jIkkicgnBP9JT9XvnvT4jIonO43wROcPZ/w0ikq3BmwF1EUx4Iw3N5SIiIcv9zj73AteLiNfpVfWeCWL4OfBlEdnonLN0EfmIiGRO47hMnLIkYeaCx0Wkh+Afz+8DN6rqgdACThvBbQTr/xsJ3qFri7OulWBbwTcJVkF9C7hKVVucza8n2PDcBvw98IupBqqq3cAHnfduAJqAOwhWlQF8BqgWkS7gy8CnneUrgT8CPcArwE9U9U/Ouq8TTFwjVVe/nSCGCoLtEj8G2glWY31uqsdk4pvdT8IYY0xYdiVhjDEmLEsSxhhjwrIkYYwxJixLEsYYY8KyJGGMMSYsSxLGGGPCsiRhjDEmLEsSxhhjwrIkYYwxJqz/Hz6AJrW1ZVo/AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure()\n",
    "sns.distplot(data.BloodPressure.values, bins=30, kde=True)\n",
    "plt.xlabel('BloodPressure', fontsize=12)\n",
    "#在画板上显示\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "舒张压也不应该出现0值，除非这个人挂了，其他的数据大致成正态分布，60-80之间属于正常值，人数最多，符合常理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\axes\\_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAENCAYAAAABh67pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAEV1JREFUeJzt3X2sZVV9xvHvIyAqoDDOgDiggzKtIq1IRqDVNCi+AEWHJtWAtoyEZGqCURqSivQPxcYWbX1tLQkKdVBBKWqZEqrgaGpoKzJYi+CgjEJhZGQuIm/iC4y//rH3jafjvXPPfTncuet+P8nJOXuddfZea9ad5+6z7jlrp6qQJLXrCfPdAEnSaBn0ktQ4g16SGmfQS1LjDHpJapxBL0mNM+glqXEGvSQ1zqCXpMbtPt8NAFi6dGmtWLFivpshSQvKjTfeeG9VLZuq3i4R9CtWrGDjxo3z3QxJWlCS/O8w9Zy6kaTGGfSS1DiDXpIaZ9BLUuMMeklqnEEvSY0z6CWpcQa9JDXOoJekxu0S34ydjUuvv3Poum84+lkjbIkk7Zo8o5ekxhn0ktQ4g16SGmfQS1LjDHpJapxBL0mNM+glqXEGvSQ1zqCXpMYZ9JLUOINekhpn0EtS4wx6SWqcQS9JjTPoJalxBr0kNc6gl6TGGfSS1DiDXpIaZ9BLUuOmDPokByf5apJNSW5J8ra+fEmSa5Pc1t/v15cnyUeSbE5yU5IjR90JSdLkhjmjfww4u6qeDxwDnJ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GmfQS1LjDHpJatz/AbBvn6CM7XZeAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure()\n",
    "sns.distplot(data.SkinThickness.values, bins=30, kde=False)\n",
    "plt.xlabel('SkinThickness', fontsize=12)\n",
    "#在画板上显示\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "三头肌皮肤褶层厚度，测量方法大概就是：揪起身上的一块肉（三头肌上的肉），测一下看知道自己是不是肥胖，即使瘦的皮包骨头也不该为0，但数据显示有230左右个0值，说明数据大概有1/3的样本数据缺失，缺失数据太多了，可以考虑去掉这个特征"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\axes\\_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAENCAYAAAABh67pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAE/dJREFUeJzt3X+sZ3Wd3/HnSwbRFSsgF3Z2ZuzgOq2yJg7kLmBpWgvuCsQ6bCJbWLJSQzNriilW013Y/rHalEQbVyzJLulYXMetClTdMqF0XTpANiZ1cNBZBAfKKCxcZ2Su5YcgWdLBd//4fka/nb1z7/f++M7lfub5SL75nvM5n3PO53ty7ut77ud7fqSqkCT16xXL3QBJ0ngZ9JLUOYNekjpn0E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+S/57kzUu9TuAF4PglWq40bwa9jmpV9bWq+jUGR/kPAZ9pk34C/MJQ1V880m2TlopBr6NWklOTvKf11b8IPA+81CbvAv5RkjckeR2DZxJLK5JBr6PZK4CPMHhC0FPAPwb+JUBV3QncwuAe7fcxeDC0tCJ5P3pJ6pxH9JLUOYNekjpn0EtS5wx6SeqcQS9JnTPoJalzBr0kdc6gl6TOGfSS1Ln/B+UCPMn2oDsnAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure()\n",
    "sns.distplot(data.Insulin.values, bins=30, kde=False)\n",
    "plt.xlabel('Insulin', fontsize=12)\n",
    "#在画板上显示\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "人体血糖水平是动态平衡的，餐后血糖上升，用于降血糖的胰岛素含量也会上升用于调节血糖，故正常人2 小时血清胰岛素含量这个特征应该是在某个区间，但不该为0，上图有一半以上的数据都是0，可以考虑去掉该特征"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\axes\\_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAENCAYAAADuRcXXAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAD6JJREFUeJzt3X+s3XV9x/Hna1RUcFqQC+soXTFp/JFl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size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure()\n",
    "sns.distplot(data.BMI.values, bins=30, kde=False)\n",
    "plt.xlabel('BMI', fontsize=12)\n",
    "#在画板上显示\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "数据反映被调查人的体重身高比，正常不应为0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\axes\\_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAENCAYAAAABh67pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFoFJREFUeJzt3Xu0ZGV95vHvI6AGb4B9VKRpmihjgi6NpAUcTYYVdIKO2s5EMyjR1kF7NGY0kzheYhSS0aXOZLyNRoeIEfAGQSOtCzNBvC1WpLVVVC4aegw2bbdyDBdRjIr+5o+9jxTH6j51qk510W9/P2ud1VV7v7XrV/tUP+etd+96d6oKSVK77jTrAiRJ02XQS1LjDHpJapxBL0mNM+glqXEGvSQ1zqCXpMYZ9JLUOINekhq3/6wLAFi1alWtXbt21mVI0l7lC1/4wneram6pdneIoF+7di1btmyZdRmStFdJ8s1R2jl0I0mNM+glqXEGvSQ1zqCXpMYZ9JLUOINekhpn0EtS4wx6SWqcQS9JjbtDfDP2juZ9m7eN1O7px62ZciWSNDl79JLUOINekhpn0EtS4wx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XfDHdEMgx1XVt5P8GvAlbn/hh8GwW0PX8/4uXWidU1XPZbjFM+ldC3y6qh47tHHV54H16ebp/gPgPIaH8uJtDq0hyRHAwUnuNhD2a4bUBd2w0SFJDhwI+2HPPfjY3T33ocCPgFVjBOEP6IbSFtxvGY+9FnjALtbtbmbDHXSv/x4DYb+GbhhIewmHbvZRSe6Z5Al016h9T1V9dVGTe9BNgXpjf5D1tCGb+b0kR/e9/z8Hzu97++8Bnpjkt5Psl+Su6U6FXOh5f4fuYugLPgr8qyTPSHJA//OIJL+a5M5JTklyr6r6Cd34+Cin/e2yhn7IYgvwZ/32Hw08cdhGBtqe3rd95K7ajvjcO4G/B/5X/zu4U5IHJFk8LDbMZcB/SHJgkgcCp47wmAXvBF6c5NfTeWD/Bw9+8ffxc1V1LfAPwGv71/HQ/nnfu4zn1owZ9PuejyS5ma6H9wq6A5LDTq18E92Bxe8ClwJ/N6TNOXQHcL9Nd6DuhfDzcFhPN4/2fP9c/43b3m9vBp7Snxnylr6n+G/pxql39Nt7Pd2BUujGg69J8j3geXRj4Ls1Qg1Pp/sEcz3dH7Gzd7O5U4BH0h1QfTVwLl2vfNznfibdgd0r6c4SOh8Y5QLXbwR+TBfMZ7GMsK2qv6E7zvI+ugPPH+a24zKvBf60Px7wC2c0AU+jO0C7A/hb4LT+uIP2Es5HLy1TknOBr1XVsE850h2OPXppCf0w0gP6YZaT6HrrzV6cW+3xYKy0tPsBH6L7bsF24PlV9aXZliSNzqEbSWqcQzeS1DiDXpIaZ9BLUuMMeklqnEEvSY0z6CWpcf8fX9LMxEbyx3sAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure()\n",
    "sns.distplot(data.DiabetesPedigreeFunction.values, bins=30, kde=False)\n",
    "plt.xlabel('DiabetesPedigreeFunction', fontsize=12)\n",
    "#在画板上显示\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\matplotlib\\axes\\_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAENCAYAAAABh67pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAEqZJREFUeJzt3XuMnFd9xvHvQ0yABKhz2QRjxzhUFpciCOkqCZciSrgEGiWRCjQhLRZNZVUN5S4IUDWiKlKjUm6CIrkEMBUJpAGUFFFIFEIpVWOwEyAXE+KG4JhcvAjCtQJMf/3jfd0MZuPdnZn17hx/P9Jq5j3vmZnf8c48+/rMO2dSVUiS2vWgpS5AkrS4DHpJapxBL0mNM+glqXEGvSQ1zqCXpMYZ9JLUOINekho3Z9An+VCS3UlummXfG5JUkqP77SR5b5IdSb6R5MTFKFqSNH8r5tHnI8D7gI8ONiY5DngesHOg+YXA+v7nZOAD/eV+HX300bVu3bp5FSxJ6mzbtu17VTU1V785g76qvpRk3Sy73gW8EbhioO1M4KPVratwXZKVSVZV1d37e4x169axdevWuUqRJA1I8p359Btqjj7JGcB3q+rr++xaDdw5sL2rb5MkLZH5TN38miSHAW8Fnj/b7lnaZl01LclGYCPA2rVrF1qGJGmehjmi/23geODrSe4A1gDXJ3kU3RH8cQN91wB3zXYnVbWpqqaranpqas4pJknSkBYc9FV1Y1UdU1XrqmodXbifWFX3AFcCL+/PvjkF+OFc8/OSpMU1n9MrLwX+C3hckl1JzttP988CtwM7gH8C/mIsVUqShjafs27OmWP/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/DHBykvv2/gDn0h39S8uSUzc66PRLRb8UOCTJPX3zQ4CVwLF0qw2uAb7V7ztu4OZ3Av9eVc87QOVKI3P1Sh10kpxDNw9/AvCLgV2XAV+lC/lf0S0ruxa4CthZVc/s17C/CfgruuVm6e/nJ1U1+IXp0rLh1I0ORhuAD1fVzqq6Z+8P8D66aZhXAr8F3AP8M92XYPwcoKp+TPclJWfTfTvQPcBFdP8jkJYlj+ilOSS5CHhUVW2Ys7O0DHlEL+2jP0/+yemcBJzH/d9GJU0c34yVftMj6KZrHk33RdT/wGR8T6k0K6duJKlxTt1IUuMMeklqnEEvSY0z6CWpcQa9JDXOoJekxv0fMHwGbcSSSdYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure()\n",
    "sns.distplot(data.Age.values, bins=30, kde=False)\n",
    "plt.xlabel('Age', fontsize=12)\n",
    "#在画板上显示\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "反映被调查人的年龄阶段分布"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 数据准备"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(768, 8)"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = data.drop('SkinThickness', axis=1)\n",
    "#data = data.drop('Insulin', axis=1)\n",
    "\n",
    "data.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "三头肌皮肤褶层厚度和血清胰岛素两个特征为0值的样本数太多，但不确定是否去除之后更合理些，通过后续模型训练，分别尝试去除看效果如何，但就目前而言，我认为 SkinThickness 这个特征不该出现0值，所以决定先剔除这个特征"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(768, 8)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "for i in range(768):\n",
    "    if data.Glucose.values[i] == 0:\n",
    "        data.Glucose.values[i] = 117\n",
    "    if data.BloodPressure.values[i] == 0:\n",
    "        data.BloodPressure.values[i] = 72\n",
    "    if data.BMI.values[i] == 0:\n",
    "        data.BMI.values[i] = 32\n",
    "        \n",
    "data.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从特征工程可看出，有三个特征（血浆葡萄糖浓度、舒张压、体重指数）对应的样本数据存在少部分缺失，其中零值即为缺失值，使用对应特征的中位数进行替换填充，由于读取的数据文件缺失值使用了零值编码，而不是直接空着，无法使用sklearn.preprocessing.Imputer进行填充，故使用循环判断的方式进行填充 \n",
    "\n",
    "其中中位数如下：  \n",
    "Glucose ：117  \n",
    "BloodPressure ：72  \n",
    "BMI ：32  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 从原始数据中分离输入特征x和输出y\n",
    "y = data['Outcome'].values\n",
    "X = data.drop('Outcome', axis = 1)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(614, 7)"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#将数据分割训练数据与测试数据\n",
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "# 随机采样20%的数据构建测试样本，其余作为训练样本\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=33, test_size=0.2)\n",
    "X_train.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train = np.array(X_train)\n",
    "X_test = np.array(X_test)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 数据预处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 数据标准化\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "\n",
    "# 初始化特征的标准化器\n",
    "ss_X = StandardScaler()\n",
    "\n",
    "# 分别对训练和测试数据的特征进行标准化处理\n",
    "X_train = ss_X.fit_transform(X_train)\n",
    "X_test = ss_X.transform(X_test)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 模型训练"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  Logistic Regression"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1 default Logistic Regression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "logloss of each fold is:  [0.45679707 0.47306945 0.52941982 0.4177863  0.46965247]\n",
      "cv logloss is: 0.469345022245065\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.\n",
      "  \"This module will be removed in 0.20.\", DeprecationWarning)\n"
     ]
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "lr= LogisticRegression()\n",
    "\n",
    "# 交叉验证用于评估模型性能和进行参数调优（模型选择）\n",
    "#分类任务中交叉验证缺省是采用StratifiedKFold\n",
    "from sklearn.cross_validation import cross_val_score\n",
    "loss = cross_val_score(lr, X_train, y_train, cv=5, scoring='neg_log_loss')\n",
    "print ('logloss of each fold is: ',-loss)\n",
    "print('cv logloss is:', -loss.mean())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "使用缺省参数的logistic回归模型，即正则函数penalty='l2',正则参数C=1.0  \n",
    "使用5折交叉验证来评价模型性能和参数调优，其中评价指标选择neg_log_loss，由于是负数，打印结果进行取反，其中损失值越小越好，最终得出的logloss值为0.469345022245065"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "the train score is: 0.7866449511400652\n",
      "the test score is: 0.7272727272727273\n"
     ]
    }
   ],
   "source": [
    "lr1 = lr.fit(X_train, y_train)\n",
    "\n",
    "train_score = lr1.score(X_train, y_train)\n",
    "test_score = lr1.score(X_test, y_test)\n",
    "\n",
    "print('the train score is:', train_score)\n",
    "print('the test score is:', test_score)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "缺省参数的logistic回归在测试集上的分数为0.7272727272727273"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2 正则化的 Logistic Regression及参数调优"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "目标函数：J = sum(logloss(f(xi), yi)) + C* penalty  \n",
    "\n",
    "需要调整的超参数：  \n",
    "1）C 正则系数，一般在log域（取log后的值）均匀设置候选参数  \n",
    "2）penalty 正则函数（L2/L1）\n",
    "\n",
    "skilearn中调用方法：置候选参数集合，以字典形式存储，调用GridSearchCV，调用fit"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=5, error_score='raise',\n",
       "       estimator=LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "          intercept_scaling=1, max_iter=100, multi_class='ovr', n_jobs=1,\n",
       "          penalty='l2', random_state=None, solver='liblinear', tol=0.0001,\n",
       "          verbose=0, warm_start=False),\n",
       "       fit_params=None, iid=True, n_jobs=1,\n",
       "       param_grid={'penalty': ['l1', 'l2'], 'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]},\n",
       "       pre_dispatch='2*n_jobs', refit=True, return_train_score='warn',\n",
       "       scoring='neg_log_loss', verbose=0)"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "\n",
    "#需要调优的参数\n",
    "#tuned_parameters = {'penalty':['l1','l2'],\n",
    "#                   'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "#                   }\n",
    "penaltys = ['l1','l2']\n",
    "Cs = [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "tuned_parameters = dict(penalty = penaltys, C = Cs)\n",
    "\n",
    "lr_penalty= LogisticRegression()\n",
    "grid= GridSearchCV(lr_penalty, tuned_parameters,cv=5, scoring='neg_log_loss')\n",
    "grid.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "查看交叉网格搜索的完整结果（存放在cv_results_中）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('mean_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split0_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split1_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split2_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split3_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split4_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('std_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'mean_fit_time': array([0.00180073, 0.00120077, 0.00100141, 0.00100131, 0.00100098,\n",
       "        0.00100069, 0.001401  , 0.00119991, 0.0010004 , 0.00120087,\n",
       "        0.00100083, 0.00100069, 0.0010006 , 0.00120077]),\n",
       " 'mean_score_time': array([0.00140238, 0.00079989, 0.0016006 , 0.00080051, 0.00100045,\n",
       "        0.00100074, 0.00100112, 0.00100179, 0.00100069, 0.00080051,\n",
       "        0.0010005 , 0.00100083, 0.00100064, 0.00080075]),\n",
       " 'mean_test_score': array([-0.69314718, -0.63827633, -0.66359655, -0.51918011, -0.47469201,\n",
       "        -0.46995731, -0.46980389, -0.46940806, -0.47001248, -0.46998406,\n",
       "        -0.47005862, -0.47005365, -0.47006164, -0.47006074]),\n",
       " 'mean_train_score': array([-0.69314718, -0.63754022, -0.66249583, -0.51492301, -0.46466921,\n",
       "        -0.45830275, -0.4538618 , -0.4537296 , -0.45364806, -0.45364673,\n",
       "        -0.45364583, -0.45364581, -0.4536458 , -0.4536458 ]),\n",
       " 'param_C': masked_array(data=[0.001, 0.001, 0.01, 0.01, 0.1, 0.1, 1, 1, 10, 10, 100,\n",
       "                    100, 1000, 1000],\n",
       "              mask=[False, False, False, False, False, False, False, False,\n",
       "                    False, False, False, False, False, False],\n",
       "        fill_value='?',\n",
       "             dtype=object),\n",
       " 'param_penalty': masked_array(data=['l1', 'l2', 'l1', 'l2', 'l1', 'l2', 'l1', 'l2', 'l1',\n",
       "                    'l2', 'l1', 'l2', 'l1', 'l2'],\n",
       "              mask=[False, False, False, False, False, False, False, False,\n",
       "                    False, False, False, False, False, False],\n",
       "        fill_value='?',\n",
       "             dtype=object),\n",
       " 'params': [{'C': 0.001, 'penalty': 'l1'},\n",
       "  {'C': 0.001, 'penalty': 'l2'},\n",
       "  {'C': 0.01, 'penalty': 'l1'},\n",
       "  {'C': 0.01, 'penalty': 'l2'},\n",
       "  {'C': 0.1, 'penalty': 'l1'},\n",
       "  {'C': 0.1, 'penalty': 'l2'},\n",
       "  {'C': 1, 'penalty': 'l1'},\n",
       "  {'C': 1, 'penalty': 'l2'},\n",
       "  {'C': 10, 'penalty': 'l1'},\n",
       "  {'C': 10, 'penalty': 'l2'},\n",
       "  {'C': 100, 'penalty': 'l1'},\n",
       "  {'C': 100, 'penalty': 'l2'},\n",
       "  {'C': 1000, 'penalty': 'l1'},\n",
       "  {'C': 1000, 'penalty': 'l2'}],\n",
       " 'rank_test_score': array([14, 12, 13, 11, 10,  3,  2,  1,  5,  4,  7,  6,  9,  8]),\n",
       " 'split0_test_score': array([-0.69314718, -0.63879793, -0.66245427, -0.51815689, -0.47688711,\n",
       "        -0.46213674, -0.4591558 , -0.45679707, -0.45674713, -0.45652485,\n",
       "        -0.45652981, -0.45650271, -0.45650235, -0.45650056]),\n",
       " 'split0_train_score': array([-0.69314718, -0.63763049, -0.65374624, -0.51609693, -0.46580613,\n",
       "        -0.46096146, -0.45685926, -0.45672775, -0.45665505, -0.45665372,\n",
       "        -0.45665292, -0.45665291, -0.4566529 , -0.4566529 ]),\n",
       " 'split1_test_score': array([-0.69314718, -0.64010309, -0.66356146, -0.5273538 , -0.47455653,\n",
       "        -0.47779433, -0.47276622, -0.47306945, -0.4727668 , -0.47281708,\n",
       "        -0.47279927, -0.47279607, -0.47279048, -0.47279402]),\n",
       " 'split1_train_score': array([-0.69314718, -0.63651289, -0.66509055, -0.51266742, -0.46474839,\n",
       "        -0.45817369, -0.45431312, -0.45417516, -0.45410808, -0.45410668,\n",
       "        -0.45410593, -0.45410591, -0.4541059 , -0.4541059 ]),\n",
       " 'split2_test_score': array([-0.69314718, -0.63994469, -0.66119179, -0.53091418, -0.50882844,\n",
       "        -0.51152388, -0.52875636, -0.52941982, -0.53303652, -0.53310008,\n",
       "        -0.53349869, -0.53350334, -0.53355119, -0.53354405]),\n",
       " 'split2_train_score': array([-0.69314718, -0.63647746, -0.65490611, -0.50887194, -0.45278244,\n",
       "        -0.44477393, -0.43894305, -0.43881918, -0.43870347, -0.43870229,\n",
       "        -0.43870098, -0.43870097, -0.43870096, -0.43870096]),\n",
       " 'split3_test_score': array([-0.69314718, -0.63308469, -0.66721469, -0.49417598, -0.43761577,\n",
       "        -0.42488255, -0.41860808, -0.4177863 , -0.41747391, -0.41740083,\n",
       "        -0.41737451, -0.41736873, -0.4173643 , -0.41736559]),\n",
       " 'split3_train_score': array([-0.69314718, -0.64042628, -0.67228314, -0.52417435, -0.4764098 ,\n",
       "        -0.47013187, -0.46596781, -0.46584018, -0.46576545, -0.46576416,\n",
       "        -0.46576334, -0.46576333, -0.46576332, -0.46576332]),\n",
       " 'split4_test_score': array([-0.69314718, -0.63941407, -0.66359927, -0.52515329, -0.47525754,\n",
       "        -0.47317231, -0.46940004, -0.46965247, -0.46971636, -0.46975751,\n",
       "        -0.46977014, -0.46977701, -0.46977936, -0.46977906]),\n",
       " 'split4_train_score': array([-0.69314718, -0.63665397, -0.6664531 , -0.51280443, -0.46359929,\n",
       "        -0.45747282, -0.45322574, -0.45308572, -0.45300825, -0.45300682,\n",
       "        -0.45300595, -0.45300594, -0.45300593, -0.45300593]),\n",
       " 'std_fit_time': array([1.16670301e-03, 3.99422713e-04, 6.32787243e-04, 1.01601008e-06,\n",
       "        7.92181383e-07, 3.81469727e-07, 4.90135077e-04, 4.00807328e-04,\n",
       "        2.13248060e-07, 4.00328647e-04, 3.16297988e-07, 1.78416128e-07,\n",
       "        9.53674316e-08, 4.00257111e-04]),\n",
       " 'std_score_time': array([4.91731739e-04, 3.99947433e-04, 4.91129556e-04, 4.00257253e-04,\n",
       "        5.09122765e-07, 6.84390073e-07, 1.13843311e-06, 1.95095754e-06,\n",
       "        9.53674316e-08, 4.00257111e-04, 1.90734863e-07, 2.78041453e-07,\n",
       "        1.50789149e-07, 4.00376416e-04]),\n",
       " 'std_test_score': array([0.        , 0.00262559, 0.00200583, 0.01313368, 0.02253037,\n",
       "        0.02786625, 0.03523757, 0.0358575 , 0.03716502, 0.03722395,\n",
       "        0.03736617, 0.0373713 , 0.03738876, 0.03738615]),\n",
       " 'std_train_score': array([0.        , 0.00150385, 0.00710413, 0.00516056, 0.0075044 ,\n",
       "        0.00813303, 0.00870307, 0.00870159, 0.0087159 , 0.00871586,\n",
       "        0.00871603, 0.00871603, 0.00871604, 0.00871604])}"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# view the complete results (list of named tuples)\n",
    "grid.cv_results_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "取出交叉搜索得出的最优超参数 C 和 penalty，以及分数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.46940805697936966\n",
      "{'C': 1, 'penalty': 'l2'}\n"
     ]
    }
   ],
   "source": [
    "# examine the best model\n",
    "print(-grid.best_score_)\n",
    "print(grid.best_params_)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "由于C = 1在所设置的候选参数中间，所以以上的候选参数范围不需要变更，若最佳值在候选参数边缘，如0.001或1000，则再尝试更大的候选参数或更小的候选参数，直到找到拐点"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "the train score is: 0.7866449511400652\n",
      "the test score is: 0.7272727272727273\n"
     ]
    }
   ],
   "source": [
    "lr2 = LogisticRegression(C=1.0, penalty='l2')\n",
    "lr2 = lr2.fit(X_train, y_train)\n",
    "\n",
    "train_score = lr2.score(X_train, y_train)\n",
    "test_score = lr2.score(X_test, y_test)\n",
    "\n",
    "print('the train score is:', train_score)\n",
    "print('the test score is:', test_score)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "得出最优超参数 C = 1，l2正则，损失为0.46940805697936966，和上面不用参数调优方法的缺省logistic回归得到的损失差不多（0.469345022245065），事实上还差一点点\n",
    "\n",
    "疑惑：同一个训练集，同样的参数，为什么第二次参数调优得出损失值比第一次直接用缺省参数的损失值还高一点点，不该是一样么？  \n",
    "猜测：虽然是同一个训练集，但第一次直接用了5折交叉验证，第二次在gridcv中又重新用了一次5折交叉验证，两次交叉验证是独立的，并且都是随机的将训练集划分为5份，因为不是用的不是一模一样的划分，所以造成训练结果有略微的差别，而且GridSearchCV的目的是为了找出多个参数下，损失值相对较低时所对应的的参数，达到此目的就行了。在最终测试集上的结果，两个分数是一样的"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('mean_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('std_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzs3Xd4VGX6//H3PZNKSAESaoAAUkMVFAXEhoBICwiCYl0XdXEBf+La9mvdomLbVXZRUawrIBaKSLEgCoIU6UhvobckQAgpc//+mAFCCGRShkkm9+u6ZnPOmefMfA4uuXlOeR5RVYwxxpgLcfg7gDHGmNLPioUxxpgCWbEwxhhTICsWxhhjCmTFwhhjTIGsWBhjjCmQFQtjjDEFsmJhjDGmQFYsjDHGFCjI3wFKSmxsrCYkJPg7hjHGlClLly49qKpxBbXzabEQke7AvwAnME5VX8jz/mvAtZ7VCkBVVY3xvHcn8FfPe39T1Q8u9F0JCQksWbKkJOMbY0zAE5Ht3rTzWbEQEScwBrgBSAYWi8hUVV17qo2qPpSr/Z+BNp7lysDTQDtAgaWefY/4Kq8xxpjz8+U1i8uBTaq6RVUzgQlAnwu0Hwx86lnuBsxR1cOeAjEH6O7DrMYYYy7Al8WiFrAz13qyZ9s5RKQuUA/4vrD7GmOM8T1fXrOQfLadbzz0QcBkVc0pzL4iMhQYClCnTp2iZDTGBICsrCySk5PJyMjwd5RSKywsjPj4eIKDg4u0vy+LRTJQO9d6PLD7PG0HAcPy7HtNnn3n5t1JVd8G3gZo166dTcxhTDmVnJxMZGQkCQkJiOT3b83yTVU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vGsFolIrd4tjtE5D+ensJ0EZkhIjd7drsNmOJp1wBoD/xVVV0AntFpv/a0/crT3phSwbq5xhRNP6A10Ar3E82LRWQe0BFIAFoAVXEPf/2eZ5+OwKee5UTcT6PnnOfzVwOX+SS5MUVgPQtjiqYT8KlnxM99wI+4f7l3Aj5TVZeq7gV+yLVPDeCANx/uKSKZnsl5jPE7KxbGFE1+w49faDvACSDMs7wGaCUiF/o7GApkFCGbMSXOioUxRTMPuMUz8Uwc0Bn4Ffe0lv091y6q4R5475R1wCUAqroZWAI86xkFFRFpeGoODxGpAhxQ1ayLdUDGXIgVC2OK5ktgJbAC+B74i+e00+e457FYjXve8EVAqmefrzm7eNwLVAc2icgq4B3OzHdxLVDmRkE1gctGnTWmhIlIRVU95ukd/Ap0VNW9nvkGfvCsn+/C9qnP+AJ4vAzPP24CjN0NZUzJm+6ZkCYEeN7T40BVT4jI07jn4d5xvp09EyV9ZYXClCbWszDGGFMgu2ZhjPn/7dWBAAAAAIAgf+sRFiiJYMkCgCULAJYsAFiyAGDJAoAVO7HVBtaZUYEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# plot CV误差曲线\n",
    "test_means = grid.cv_results_[ 'mean_test_score' ]\n",
    "test_stds = grid.cv_results_[ 'std_test_score' ]\n",
    "train_means = grid.cv_results_[ 'mean_train_score' ]\n",
    "train_stds = grid.cv_results_[ 'std_train_score' ]\n",
    "\n",
    "\n",
    "# plot results\n",
    "n_Cs = len(Cs)\n",
    "number_penaltys = len(penaltys)\n",
    "test_scores = -np.array(test_means).reshape(n_Cs,number_penaltys)\n",
    "train_scores = -np.array(train_means).reshape(n_Cs,number_penaltys)\n",
    "test_stds = -np.array(test_stds).reshape(n_Cs,number_penaltys)\n",
    "train_stds = -np.array(train_stds).reshape(n_Cs,number_penaltys)\n",
    "\n",
    "x_axis = np.log10(Cs)\n",
    "for i, value in enumerate(penaltys):\n",
    "    #pyplot.plot(log(Cs), test_scores[i], label= 'penalty:'   + str(value))\n",
    "    pyplot.errorbar(x_axis, test_scores[:,i], yerr=test_stds[:,i] ,label = penaltys[i] +' Test')\n",
    "    pyplot.errorbar(x_axis, train_scores[:,i], yerr=train_stds[:,i] ,label = penaltys[i] +' Train')\n",
    "    \n",
    "pyplot.legend()\n",
    "pyplot.xlabel( 'log(C)' )                                                                                                      \n",
    "pyplot.ylabel( '- neg-logloss' )\n",
    "pyplot.savefig('LogisticGridSearchCV_C.png' )\n",
    "\n",
    "pyplot.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "在L1正则和L2正则下，不同的正则参数C对应的模型在训练集上和测试集上的负log损失，可以看出在训练集上C越大（正则越小）的模型性能越好，在测试集上，L2正则和L1正则都是在log(C)为0时，即C=1时性能最好"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3 用LogisticRegressionCV实现正则化的 Logistic Regression"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.1 L1正则"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegressionCV(Cs=[0.01, 0.1, 1, 10, 100], class_weight=None, cv=5,\n",
       "           dual=False, fit_intercept=True, intercept_scaling=1.0,\n",
       "           max_iter=100, multi_class='ovr', n_jobs=1, penalty='l1',\n",
       "           random_state=None, refit=True, scoring='neg_log_loss',\n",
       "           solver='liblinear', tol=0.0001, verbose=0)"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegressionCV\n",
    "\n",
    "Cs = [0.01, 0.1, 1, 10, 100]\n",
    "\n",
    "# LogisticRegressionCV比GridSearchCV快\n",
    "lrcv_L1 = LogisticRegressionCV(Cs=Cs, cv = 5, scoring='neg_log_loss', penalty='l1', solver='liblinear', multi_class='ovr')\n",
    "lrcv_L1.fit(X_train, y_train)    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "由缺省参数的logistic回归可得出，L1正则下，最优的正则系数C大概是1左右，故选取的候选区间以1为中心，取五个进行比较"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1: array([[-0.66245427, -0.47689195, -0.45916104, -0.45674872, -0.45652284],\n",
       "        [-0.66356146, -0.47456724, -0.47276548, -0.47277448, -0.47279726],\n",
       "        [-0.66119179, -0.50883054, -0.52876052, -0.53303045, -0.53349147],\n",
       "        [-0.66721469, -0.4376144 , -0.41860586, -0.41747256, -0.41737486],\n",
       "        [-0.66359927, -0.4752592 , -0.4693966 , -0.46971241, -0.46976839]])}"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lrcv_L1.scores_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZIAAAEKCAYAAAA4t9PUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xt0HvV95/H3R5Ll+93yVVLMxQTsAAYkkSxpCqQlJhdDAhg5aQNpUk66y8nmZJsGzmabU9Kctttu0u0u7QZomqQnweaOCeE45EJuBWwZfDcGYy6WbWzZBmPjm2R9949n5DyWdXnkR6OR/XxeJxPN85vfb+Y7g/x8NfOb+Y0iAjMzs5NVlnUAZmZ2anMiMTOzojiRmJlZUZxIzMysKE4kZmZWFCcSMzMrihOJmZkVxYnEzMyK4kRiZmZFqcg6gIEwadKkmDlzZtZhmJ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HdpFfAL4NwBiuteYDvQmvx+fRb4PPD5ZLmAO5O419DDnYwDGNOtecfqGeA/DdCxej+5y1Sr8763PjyQx8tPtpuZWVF8acvMzIriRGJmZkVxIjEzs6I4kZiZWVGcSMzMrChOJGb9QNL+Its/kDxdj6RRkr4t6eVkNNdfSbpUUmUyX5IPEtvg5URilrFkTKbyiNicFN1D7qn2WRExh9wIvJMiN7Diz4AbMwnUrBtOJGb9KHly+O8lrVXuvTA3JuVlyZAZ6yT9SNKPJV2fNPsUyZP3ks4CLgW+GhHtkBu+JSIeT+o+ktQ3GzR8imzWvz4BzAUuBCYByyX9itzwKzOB88mNRLwB+E7S5jJyT00DzAFWRsTRbta/FqhPJXKzk+QzErP+9X5yo+UejYgdwC/JffG/H7g/Itoj4g1yw410mAa0FLLyJMEc6RhTzWwwcCIx61/dvYyqp5dUHSQ31hbkxmq6UFJP/zaHAodOIjazVDiRmPWvXwE3SiqXVEXu9azLgN+Qe0FUmaQp5F7L2mEDcDZA5N6F0gT8Vd5IsrMkXZPMTwRaIqJ1oHbIrDdOJGb962Fyo7CuAn4O/EVyKetBciPGrgW+Te4NdnuTNo9zfGL5HLkXdm2StIbce0A63h1xBfDjdHfBrG88+q/ZAJE0KnJvz5tI7izlsoh4Q9Jwcn0ml/XQyd6xjoeA2yNi4wCEbFYQ37VlNnB+JGkcUAl8PTlTISIOSvoauXdov95d4+TlU484idhg4zMSMzMrivtIzMysKE4kZmZWFCcSMzMrihOJmZkVxYnEzMyK4kRiZmZF+f+iPcIxTlsLeAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# scores_：dict with classes as the keys, and the values as the grid of scores obtained during cross-validating each fold,\n",
    "# Each dict value has shape (n_folds, len(Cs))\n",
    "n_Cs = len(Cs)\n",
    "#n_classes = 9\n",
    "#scores =  np.zeros((n_classes,n_Cs))\n",
    "\n",
    "#for j in range(n_classes):\n",
    "#        scores[j][:] = np.mean(lrcv_L1.scores_[1],axis = 0)\n",
    "scores =  np.zeros((1,n_Cs))\n",
    "scores[0][:] = np.mean(lrcv_L1.scores_[1],axis = 0)\n",
    "    \n",
    "mse_mean = -np.mean(scores, axis = 0)\n",
    "pyplot.plot(np.log10(Cs), mse_mean.reshape(n_Cs,1)) \n",
    "pyplot.xlabel('log(C)')\n",
    "pyplot.ylabel('neg-logloss')\n",
    "pyplot.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "lrcv_L1_coef: [[ 0.4169155   1.13455935 -0.13763942 -0.12840964  0.740076    0.20350331\n",
      "   0.13142497]]\n",
      "lrcv_L1_C: [1.]\n"
     ]
    }
   ],
   "source": [
    "print(\"lrcv_L1_coef:\",lrcv_L1.coef_)\n",
    "print('lrcv_L1_C:',lrcv_L1.C_)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "可以得出，L1正则下，最优的参数C=1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "the lrcv_L1 train score is: 0.7833876221498371\n",
      "the lrcv_L1 test score is: 0.7207792207792207\n"
     ]
    }
   ],
   "source": [
    "lrcv_L1_train_score = lrcv_L1.score(X_train, y_train)\n",
    "lrcv_L1_test_score = lrcv_L1.score(X_test, y_test)\n",
    "\n",
    "print('the lrcv_L1 train score is:', lrcv_L1_train_score)\n",
    "print('the lrcv_L1 test score is:', lrcv_L1_test_score)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "L1正则下，C=1时训练出的模型在测试集上的分数为0.7207792207792207"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3.2 L2正则"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegressionCV(Cs=[0.001, 0.01, 0.1, 1, 10], class_weight=None, cv=5,\n",
       "           dual=False, fit_intercept=True, intercept_scaling=1.0,\n",
       "           max_iter=100, multi_class='ovr', n_jobs=1, penalty='l2',\n",
       "           random_state=None, refit=True, scoring='neg_log_loss',\n",
       "           solver='liblinear', tol=0.0001, verbose=0)"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegressionCV\n",
    "\n",
    "#Cs = [1, 10,100,1000]\n",
    "Cs = [0.001, 0.01, 0.1, 1, 10]\n",
    "\n",
    "# 大量样本（6W+）、高维度（93），L2正则 --> 缺省用lbfgs，为了和GridSeachCV比较，也用liblinear\n",
    "\n",
    "lrcv_L2 = LogisticRegressionCV(Cs=Cs, cv = 5, scoring='neg_log_loss', penalty='l2', solver='liblinear', multi_class='ovr')\n",
    "lrcv_L2.fit(X_train, y_train)    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1: array([[-0.63879793, -0.51815689, -0.46213674, -0.45679707, -0.45652485],\n",
       "        [-0.64010309, -0.5273538 , -0.47779433, -0.47306945, -0.47281708],\n",
       "        [-0.63994469, -0.53091418, -0.51152388, -0.52941982, -0.53310008],\n",
       "        [-0.63308469, -0.49417598, -0.42488255, -0.4177863 , -0.41740083],\n",
       "        [-0.63941407, -0.52515329, -0.47317231, -0.46965247, -0.46975751]])}"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lrcv_L2.scores_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZIAAAEKCAYAAAA4t9PUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/A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zRA0nHJ+M5AeURsaqgNMquNE4lZ/bqfTOXoOcA/gH9PTmX9L5mqrPOAG4EZZN7qB5l33hyRtY5zybyAqkzSXDLvtah8d8SRwCPpboLZ9nH1X7MGImmniFiXHFW8RObtjG9LakvmmsmIbVxkr1zH34HLogDfR2/Nl+/aMms4D0vqDLQCfpEcqRAR6yX9jMw7tN+oqXPyMqUHnESs0PiIxMzM6sTXSMzMrE6cSMzMrE6cSMzMrE6cSMzMrE6cSMzMrE6cSMzMrE7+Px65w8tj6cFJAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# scores_：dict with classes as the keys, and the values as the grid of scores obtained during cross-validating each fold,\n",
    "# Each dict value has shape (n_folds, len(Cs))\n",
    "n_Cs = len(Cs)\n",
    "#n_classes = 9\n",
    "#scores =  np.zeros((n_classes,n_Cs))\n",
    "\n",
    "#for j in range(n_classes):\n",
    "#        scores[j][:] = np.mean(lrcv_L1.scores_[1],axis = 0)\n",
    "scores =  np.zeros((1,n_Cs))\n",
    "scores[0][:] = -np.mean(lrcv_L2.scores_[1],axis = 0)\n",
    "    \n",
    "mse_mean = np.mean(scores, axis = 0)\n",
    "pyplot.plot(np.log10(Cs), mse_mean.reshape(n_Cs,1)) \n",
    "pyplot.xlabel('log(C)')\n",
    "pyplot.ylabel('neg-logloss')\n",
    "pyplot.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "lrcv_L2_coef: [[ 0.42068374  1.13824681 -0.15599435 -0.14091092  0.75255179  0.21396659\n",
      "   0.14405214]]\n",
      "lrcv_L2_C: [1.]\n"
     ]
    }
   ],
   "source": [
    "print(\"lrcv_L2_coef:\",lrcv_L2.coef_)\n",
    "print('lrcv_L2_C:',lrcv_L2.C_)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "可以得出，L2正则下，最优的参数C=1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "the lrcv_L2 train score is: 0.7866449511400652\n",
      "the lrcv_L2 test score is: 0.7272727272727273\n"
     ]
    }
   ],
   "source": [
    "lrcv_L2_train_score = lrcv_L2.score(X_train, y_train)\n",
    "lrcv_L2_test_score = lrcv_L2.score(X_test, y_test)\n",
    "\n",
    "print('the lrcv_L2 train score is:', lrcv_L2_train_score)\n",
    "print('the lrcv_L2 test score is:', lrcv_L2_test_score)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "L2正则下，C=1时训练出的模型在测试集上的分数为0.7272727272727273"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "疑惑：上面几个模型在测试集上的分数其实都小于训练集上的参数，一方面可能是因为训练出的模型有一点过拟合，另一方面也有可能是因为数据本身的分类结果是不均衡的，可以试着在LogisticRegressionCV参数里面增加class_weight进行参数调节，以此获得更好的训练模型。关于class_weight的调节，将在SVM作业中展现"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
